package org.rambadger.command.view.rss;


import com.google.common.collect.Lists;

import javax.xml.bind.annotation.*;
import java.util.List;


@XmlRootElement(name = "rss")
public class RSSView {
    @XmlAttribute public String version = "2.0";

    @XmlElement(name = "channel")
    public List<RSSChannel> channels = Lists.newArrayList();

    public RSSView() {}

    public RSSView(List<RSSChannel> channels) {
        this.channels = channels;
    }

    public RSSView(String title, String link, String description, List<RSSItem> items) {
        RSSChannel channel = new RSSChannel(title, link, description, items);
        this.channels = Lists.<RSSChannel>newArrayList(channel);
    }


}
